#include"processbar.h"
#include<string.h>
#include<unistd.h>
const char * lable = "|/-\\";
//#void processbar(int speed)#{
//# char s[num];
//#memset(s,'\0',sizeof(s));
//int cnt = 0;
//while(cnt <=top)
//  {
//  printf("[%-100s][%d%%][%c]\r",s,cnt,lable[cnt%strlen(lable)]);
//bin  s[cnt++] = body;
 // if(cnt<top)
 // s[cnt ] = '>';
 // fflush(stdout);
 // usleep(speed);
 // 
//}
//printf("\n");
//}

void processbar(int rate)//只打印一次进程
{
  if(rate<0||rate>100)
    return ;
  printf("[%-100s][%d%%][%c]\r",s,rate,lable[rate%strlen(lable)]);
  s[rate++] = body;
  if(rate<top)
  s[rate ] = right;
  fflush(stdout);
  usleep(50000);
}
